[#ftl]
[#assign entityName="PageMenus"]
[#assign pathRoot="/admin/cms/basic/menus/menus_"]
[@jsec.authPage perms=["${entityName}ctrl"]/]
[@frame.root]
  <!-- Default panel contents -->
  [@frame.title]
  	编辑栏目
  [/@]
[@frame.body]
  	[#global ent=(jdao.hql("from ${entityName} where id=?",[jweb.pathName("id")])()[0])!{}]
    [@form.form id="ent" action="${base}${pathRoot}save.shtml" back="${base}${pathRoot}list.shtml"]
		[@form.text id="name" label="名称" length=3 required=true  /]
		[@form.select2 id="parent.id" value="id" title="name" datas=jdao.hql("from PageMenus where parent is null",[])() label="父菜单" length=1 /]
		[@form.select2 id="pagesTemplate.id" value="id" title="alias" datas=jdao.hql("from PagesTemplate",[])() label="页面配置" length=6 required=true/]
		[@form.enums enumName="com.ustudy.entity.cms.PageMenus$PageMenuType" length=1 id="pageMenuType" required=true label="菜单类型"/]
		[@form.digits length=1 id="sortInfo" required=true label="排序"/]
		[@form.field id="body" label="设置" length=10]
			
			<div id="body_panel">
			</div>
			<input type="hidden" id="body" name="body" value="${ent.body!}"/>
			[#if ent.pageMenuType??]
			<script type="text/javascript">
				(function(){
					$.post("${base}/admin/cms/basic/menus/menus_form_${ent.pageMenuType.name()?lower_case}_panel.shtml",{},function(h){
						$("#body_panel").html(h);
					},"html");
				})();
			</script>
			[/#if]
		[/@]
	[/@]
[/@]
[/@]
<script type="text/javascript">
	(function($){
		$("#pageMenuType").change(function(){
			$.post("${base}/admin/cms/basic/menus/menus_form_"+$(this).val().toLowerCase()+"_panel.shtml",{},function(h){
				$("#body_panel").html(h);
			},"html");
		});
	})(jQuery);
</script>